/* RMORPG - Dice.h
   Copyright (C) 2006, Michael Borgmann <code@lechuck.de>
   This code is released under the new BSD license
 */

#ifndef _DICE_H
#define _DICE_H

namespace rmorpg {

	/**
	 * Dice Rolling
	 */
	class Dice {

		private:
			int roll;

			/**
			 * Make 1d100 Roll
			 *
			 * @return result of 1d100 roll
			 */
			int Roll1d100();

			/**
			 * Make a Low Open-ended Roll
			 *
			 * @return result of low open-ended roll
			 */
			int RollLowOpenEnded();

			/**
			 * Make a High Open-ended Roll
			 *
			 * @return result of high open-ended roll
			 */
			int RollHighOpenEnded();

			/**
			 * Make an Open-ended Roll
			 *
			 * @return result of open-ended roll
			 */
			int RollOpenEnded();

			/**
			 * Make a 1d10 Roll
			 *
			 * @return result of 1d10 roll
			 */
			int Roll1d10();

			/**
			 * Make a 1d5 Roll
			 *
			 * @return result of 1d5 roll
			 */
			int Roll1d5();

			/**
			 * Make a 1d8 Roll
			 *
			 * @return result of 1d8 roll
			 */
			int Roll1d8();

			/**
			 * Make a 5d10 Roll
			 *
			 * @return result of 5d10 roll
			 */
			int Roll5d10();

			/**
			 * Make a 2d5 Roll
			 *
			 * @return result of 2d5 roll
			 */
			int Roll2d5();

		public:

			/**
			 * Dice rolling styles
			 * - _1d100
			 * - low_open_ended
			 * - high_open_ended
			 * - open_ended
			 * - _1d10
			 * - _1d5
			 * - _5d10
			 * - _2d5
			 */
			enum rolls {
				_1d100,
				low_open_ended,
				high_open_ended,
				open_ended,
				_1d10,
				_1d5,
				_1d8,
				_5d10,
				_2d5
			};

			/**
			 * Default Constructor
			 */
			Dice();

			/**
			 * Default Destructor
			 */
			virtual ~Dice();

			/**
			 * Simulate dice rolling
			 * NOTE: Refer to dice rolling styles (e.g. _1d100)
			 *
			 * @param roll the dice rolling style
			 *
			 * @return Get result of a dice roll
			 */
			int Roll(int roll);
	};
}

#endif // end _DICE_H
